<!--
 * @Author: LiYuan
 * @Date: 2021-03-31 15:56:05
 * @LastEditTime: 2021-04-13 10:49:13
 * @LastEditors: LiYuan
 * @Description: 
 * You build it, You run it.
-->
<template>
  <base-modal :title="$t('common.base.toast')" :show.sync="visible" width="600px" class="edit-point-dialog">
    <div class="base-modal-content">
      {{$t('event.detail.components.dialog.text52')}}
    </div>
    <div slot="footer">
      <el-button @click="saveCustomerInfo">{{$t('event.detail.components.eventInfo.text1')}}</el-button>
      <el-button type="primary" @click="editNext">{{$t('common.base.continue')}}</el-button>
    </div>
  </base-modal>
</template>

<script>
import { openAccurateTab } from '@src/util/platform';
import { PageRoutesTypeEnum } from 'pub-bbx-global/pageType/dist/enum/PageRoutesEnum';
export default {
  name: 'edit-point-dialog',
//   inject: ['initData'],
  props:{
    workEvent: {
      type: Object,
      default: () => {}
    }
  },
  data: () => {
    return {
      visible: false
    }
  },
  methods: {
    openDialog() {
      this.visible = true;
    },
    
    saveCustomerInfo() {
      this.visible = false
      this.$emit('onlySaveCusInfo')
    },

    editNext() {
      this.visible = false
      let fromId = window.frameElement.getAttribute('id');
      openAccurateTab({
        type: PageRoutesTypeEnum.PageEditEvent,
        key: this.workEvent.id,
        closeNowPage: true,
        fromId
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.base-modal-content {
  padding: 20px;
}
</style>